/*5：输出一个空心的等腰三角形，高度由用户输入，周围由 *组成，空格的数目分别是0，1,2,3,.....
比如，如下是一个高度为5的图形
       *
      * *
     *   *
    *     *
   *********   */
package ZUOYE0424;

import java.util.Scanner;

public class Task5之作业更改 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入高度：");
		int h = in.nextInt();
		for (int a = 1; a <= h; a++) {
			for (int b = 1; b <= h - a + 1; b++) {
				System.out.print(" ");
			}
			for (int j = 1; j <= 2 * a - 1; j++) {
				if (j == 1 || j == 2 * a - 1 || a == h) {
					System.out.print("*");
				} else {
					System.out.print(" ");
				}
			}
			System.out.println();
		}
	}

}
